const webpack = require('webpack');
const config = require('./webpack.dll.config.js');

const compiler = webpack(config);

compiler.run((err, stats) => {
    if (err) {
        return console.error(err);
    }

    const jsonStats = stats.toJson();

    if (jsonStats.errors.length > 0) {
        jsonStats.errors.forEach(function(element) {
            console.log(element);
        }, this);
    }

});
